package com.pond.pond.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pond.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 社区帖子评论对象 community_post_comment
 *
 * @author ruoyi
 * @date 2024-03-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("community_post_comment")
public class CommunityPostComment extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 评论ID */
    @TableId(type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 帖子ID */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long postId;

    /** 评论用户ID */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /** 评论内容 */
    private String content;

    /** 父评论ID（回复功能） */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    /** 点赞数 */
    private Integer likeCount;

    /** 评论状态：0-待审核，1-已发布，2-已删除 */
    private String status;

    /** 用户信息 */
    @TableField(exist = false)
    private String userName;

    /** 用户头像 */
    @TableField(exist = false)
    private String userAvatar;

    /** 当前用户是否点赞 */
    @TableField(exist = false)
    private Boolean isLiked;
}